<template>
  <div>
      <h1>{{cou}}</h1>
      <h1>{{cous}}</h1>
      <button @click="toCou">调用pinia的actions方法</button>
  </div>
  <hr>
  <cate-one></cate-one>
</template>
<script setup>
import cateOne from './cateOne.vue'
  import {computed} from 'vue'
  import {cateStore} from '../../pinia/index'
  let store =cateStore(); //调用导入的pinia模块
  console.log(store,"--------")
  //pinia的state 使用无需加state
  console.log(store.mycou)
  let cou=computed(()=>store.mycou)//将pinia中
  // 的state的数据 变为计算属性

  // 使用getters的数据 变为计算属性
  let cous=computed(()=>store.mycouS)
  
  // 调用pinia的actions改变state的数据 
  let toCou=()=>{
     store.changeCou("俄罗斯")
  }
</script>